![]()


|
<% 'declare your variables Dim oConnection, oRecordset Dim sSQL 'Create an instance of the Connection Recordset objects Set oConnection = Server.CreateObject("ADODB.Connection") Set oRecordset = Server.CreateObject("ADODB.Recordset") 'Set an active Connection to the Connection object 'open the Connection to the database oConnection.Open sConnString 'Create a variable called sSQL which holds an SQL statement to query against the database sSQL = "SELECT * FROM tblJoinFrmConfig;" 'Query the database and return a oRecordset oRecordset.Open sSQL, oConnection %> <% '''If the form has not been filled in then display this code If Request.Form("Submit")="" Then %> <% '''if the form has been submitted correctly then execute this code Else Dim oConn, oRs, sSQLCHECK, sSQLINSERT Dim sFirstname, sSurname, sAddress, sCity, sCounty, sCountry Dim sPostCode, sTel, sEmail, sHear_about_website Dim sUsername, iMembershipType Dim daysToRecharge 'receive variables posted sFirstname=Replace(Request.Form("Firstname"),"'","''") sSurname=Replace(Request.Form("Surname"),"'","''") sAddress=Replace(Request.Form("Address"),"'","''") sCity=Replace(Request.Form("City"),"'","''") sCounty=Replace(Request.Form("County"),"'","''") sCountry=Replace(Request.Form("Country"),"'","''") sPostCode=Replace(Request.Form("PostCode"),"'","''") sTel=Replace(Request.Form("Tel"),"'","''") sEmail=Replace(Request.Form("Email"),"'","''") sHear_about_website=Replace(Request.Form("hear_about_website"),"'","''") sUsername=Replace(Request.Form("Username"),"'","''") sCustom1=Replace(Request.Form("custom1"),"'","''") sCustom2=Replace(Request.Form("custom2"),"'","''") sCustom3=Replace(Request.Form("custom3"),"'","''") sCustom4=Replace(Request.Form("custom4"),"'","''") iMembershipType=Request.Form("mtid") 'check to make sure that the username hasn't already been taken sSQLCHECK= "SELECT Email FROM tblMembers WHERE Username='" & sUsername & "';" Set oRs=Server.CreateObject("ADODB.Recordset") oRs.Open sSQLCHECK,oConnection If NOT oRs.eof Then response.write "Sorry that username has already been taken. "
'close the connection and recordset objects
oRs.Close
Set oRs=Nothing
response.end 'stop the code processing any more.
Else
'make a function that will generate a random password
function makePassword(byVal maxLen)
Dim sNewPassword
Dim whatsNext, upper, lower, intCounter
Randomize
For intCounter = 1 To maxLen
whatsNext = Int((1 - 0 + 1) * Rnd + 0)
If whatsNext = 0 Then
upper = 90
lower = 65
Else
upper = 57
lower = 48
End If
sNewPassword = sNewPassword & Chr(Int((upper - lower + 1) * Rnd + lower))
Next
makePassword = sNewPassword
End function
'call the function and return a password of 5 figures
randompassword=makePassword(5)
'insert values into the database
sSQLINSERT= "INSERT INTO tblMembers(FirstName,SurName,Address,City,County,Country,Postcode," & _
"Email,tel,hear_about_website,UserName,Custom1,Custom2,Custom3,Custom4,Password,MembershipType," & _
"Active,Date_joined)values('" & sFirstname & "', '" & sSurname & "', '" & sAddress & "'," & _
" '" & sCity & "', '" & sCounty & "', '" & sCountry & "', '" & sPostcode & "', '" & sEmail & "', " & _
"'" & sTel & "','" & sHear_about_website & "', '" & sUsername & "','" & sCustom1 & "','" & sCustom2 & "','" & sCustom3 & "','" & sCustom4 & "'," & _
"'" & "dtsp" & "','1','Y',#" & Now() & "#)"
oConnection.execute(sSQLINSERT)
End If
If err.number<>0 then
response.write "Please click the back button on your browser and select a new username. Sorry we are having difficulties, please try again. "
Else
%>
To complete your registration click on Pay Pal button to start your FREE subscription.
If you like to start the subscription by using your Credit Cards click on the Credit Cards button below..
Net Billing, Inc. is an authorized retailer of Swing Trading Stock Picks. A charge from "Net Billing - Swing Trading Stock Picks" will appear on your billing statement.
|